package view;

import java.awt.Color;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPopupMenu;

/**
 * This class is invoked when the user pauses the game.
 * 
 * @author Stephanie
 *
 */
public class PauseMenu extends JPopupMenu {
	
	private JButton saveButton;
	private JButton continueButton;
	private JButton exitButton;

	public PauseMenu() {
		super("Pause");
		setLayout(null);
		setLocation(300,100);
		setSize(200,400);
		setVisible(true);
		setBackground(Color.BLACK);
		
		saveButton = new JButton("Save");
		saveButton.setSize(150,30);
		saveButton.setLocation(50,100);
		saveButton.setForeground(Color.RED);
		saveButton.setBackground(Color.BLACK);
		saveButton.setVisible(true);
		
		continueButton = new JButton("Continue");
		continueButton.setSize(150,30);
		continueButton.setLocation(50,200);
		continueButton.setForeground(Color.RED);
		continueButton.setBackground(Color.BLACK);
		continueButton.setVisible(true);
		
		exitButton = new JButton("Exit to Main Menu");
		exitButton.setSize(150,30);
		exitButton.setLocation(50,300);
		exitButton.setForeground(Color.RED);
		exitButton.setBackground(Color.BLACK);
		exitButton.setVisible(true);
		
		add(saveButton);
		addSeparator();
		add(continueButton);
		addSeparator();
		add(exitButton);
	}
	
	public void addContinueListener( ActionListener listener ) {
		continueButton.addActionListener(listener);
	}
	
	public void addExitListener( ActionListener listener ) {
		exitButton.addActionListener( listener );
	}
	
	public void addSaveListener( ActionListener listener ) {
		saveButton.addActionListener( listener );
	}
	
}
